//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'
import LoginVue from '@/views/Login.vue'
import LayoutVue from "@/views/Layout.vue";

//定义路由关系
const routes = [
    {
        path: '/login',
        component: LoginVue
    },
    {
        path: '/',
        component: LayoutVue,
        redirect: '/article/articlecategory',
        children: [
            { path: '/article/articlecategory', component: () => import('@/views/article/ArticleCategory.vue') },
            { path: '/article/articlemanage', component: () => import('@/views/article/ArticleManage.vue') },
            { path: '/user/useravatar', component: () => import('@/views/user/UserAvatar.vue') },
            { path: '/user/userinfo', component: () => import('@/views/user/UserInfo.vue') },
            { path: '/user/resetpass', component: () => import('@/views/user/UserResetPassword.vue') },
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
});

export default router